package com.leancloud.home.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.aries.ui.view.title.TitleBarView;
import com.chad.library.adapter.base.listener.OnItemChildClickListener;
import com.leancloud.home.R;
import com.leancloud.home.adapter.ComputingAdapter;
import com.leancloud.home.entity.ComputingEntity;

import java.util.ArrayList;
import java.util.List;

import tech.com.commoncore.base.BaseTitleActivity;

public class ComputingActivity extends BaseTitleActivity {

  RecyclerView recyclerView;
  ComputingAdapter mAdapter;

    @Override
    public void setTitleBar(TitleBarView titleBar) {
        titleBar.setTitleMainText(getResources().getString(R.string.home_activity_title));
    }

    @Override
    public int getContentLayout() {
        return R.layout.home_activity_computing;
    }

    @Override
    public void initView(Bundle savedInstanceState) {
        recyclerView = findViewById(R.id.rv_computing);
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        mAdapter = new ComputingAdapter(R.layout.home_itme_computing);
        recyclerView.setAdapter(mAdapter);

        getDatas();




    }


    private void getDatas() {
        List<ComputingEntity> list = new ArrayList<>();
        list.add(new ComputingEntity(getResources().getString(R.string.home_one_title),"科学申购—合理分配价值",0));
        list.add(new ComputingEntity(getResources().getString(R.string.home_two_title),"买房不可或缺的工具—时间的价值",0));
        list.add(new ComputingEntity(getResources().getString(R.string.home_three_title),"买房不可或缺的工具—时间的价值",0));
        list.add(new ComputingEntity(getResources().getString(R.string.home_four_title),"买房不可或缺的工具—时间的价值",0));
        mAdapter.setNewData(list);
    }
}
